using UnityEngine;

public class GameTypePreviewInLeaderBoard : MonoBehaviour
{
	[SerializeField]
	private GameObject likeBoxSelected;

	[SerializeField]
	private GameObject likeBoxUnselected;

	[SerializeField]
	private GameObject bonusAward;

	[SerializeField]
	private GameObject isNew;

	private GameModeConfig.ModeInfo _modeInfo;

	private int _percent;

	public GameModeConfig.ModeInfo ModeInfo
	{
		get
		{
			return _modeInfo;
		}
		set
		{
			_modeInfo = value;
		}
	}

	public void Init()
	{
		isNew.SetActive(ModeInfo.isNew);
	}

	public void SetLikePersent(int percent)
	{
		_percent = percent;
		likeBoxSelected.GetComponentInChildren<UILabel>().text = ((percent < 1000) ? percent.ToString() : (Mathf.Floor(percent / 1000) + "k"));
		likeBoxUnselected.GetComponentInChildren<UILabel>().text = ((percent < 1000) ? percent.ToString() : (Mathf.Floor(percent / 1000) + "k"));
	}

	public void RefresfViewLikeBox()
	{
		bool likeStatus = LikeModeManager.instance.GetLikeStatus(ModeInfo.typeGame);
		likeBoxSelected.SetActive(likeStatus);
		likeBoxUnselected.SetActive(!likeStatus);
	}

	public void ModifyPercent(int value)
	{
		SetLikePersent(_percent + value);
	}

	public void RefreshBonusAwardLabel()
	{
		if ((bool)BonusAwardManager.instance)
		{
			bonusAward.SetActive(BonusAwardManager.instance.IsSetBonus(ModeInfo.typeGame));
		}
	}
}
